import {createStore,createLogger} from "vuex";
import state from './state'
import mutations from "@/store/mutations";
import * as getters from './getters'
import * as actions from './actions'

//判断是否为开发环境
const debug = process.env.NODE_ENV !== 'production'

export default createStore({
    state,
    mutations,
    getters,
    actions,
    //当debug为true时开启严格模式
    strict: debug,
    plugins: debug ? [createLogger()]: []
})
//createLogger: 每次修改都会在控制台打印log
